package com.abbas.CayTcore.model

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import com.abbas.CayTcore.CoreApp
import com.abbas.CayTcore.base.BaseModel
import com.abbas.CayTcore.entity.CoreLW
import com.abbas.CayTcore.entity.TCoreBase
import com.abbas.CayTcore.subscribeDbResult
import com.abbas.CayTcore.ui.WindingFragment

class WindActivityModel : BaseModel() {

    fun getCoreData(onSuccess: (data: List<TCoreBase>) -> Unit,onnFailure: (e: Throwable) -> Unit) {
        CoreApp.db.coreDao()
            .getAll()
            .subscribeDbResult({
                it.distinctBy { coreList ->
                    coreList.getLW()
                }.also(onSuccess)
            }, {

            })
    }
}